<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>{$result.title} - 掌中游旅游</title>
		<meta name="keywords" content="{$result.title}"/>
		<meta name="description" content="欢迎前来掌中游实力旺铺，选购{$result.title}实力旺铺，更多商品任你选购"/>

		<link href="__PUBLIC__/Home/css/index.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" href="__PUBLIC__/Home/css/fangdajing.css">
<script src="__PUBLIC__/Home/js/jquery-1.8.2.min.js"></script>
<script src="__PUBLIC__/Home/js/jquery.colorbox-min.js"></script>
<script src="__PUBLIC__/Home/js/fangdajing.js"></script>
		

<script>
  $(function(){
      var pic = $('#pic_url').val();
      var id = $('.id').val();
      var price = $('.price').val();
      var name = $('#detail_title').val();
	  var type = $('#type').val();

      $.ajax({
         type: "POST",
         url: "{:U('Index/add_footprint')}",
         data: "gid="+id+"&goods_pic="+pic+"&goods_price="+price+"&goods_name="+name+"&is_type="+type,
         success: function(msg){
          console.log(msg);
         }
      });
  })
</script>		

<script>
window.onscroll = function(){
    var scrollTop = document.body.scrollTop;
    if(scrollTop >= 740){
		$('#tabs').attr('style','position:fixed; top:0; width:970px;');
    }else{
		$('#tabs').attr('style','position:static;');
	}
}
</script>
	</head>

	<body>

	
	<include file="Public:header" />
	
	
		<!-- 当季热卖 -->


<!-- 内容区 -->
<form action="{:U('Cart/before_order')}" method="post">
<div class="Content">
	<div class="daohang">当前的位置：<a href="{:U('Index/index')}">商城首页</a> > <a href="{:U('Index/goods')}">商城商品列表</a> > 详情</div>
	



<div class="Detail-Detail">
<div style="width:320px; float:left;">


<div class="box">


<div class="con-FangDa" id="fangdajing">
  <div class="con-fangDaIMg" style="border:1px solid #CCC;">
    <!-- 正常显示的图片-->
    <img style="height:312px; width:312px;" src="__PUBLIC__/Uploads/goods/{$result.pic_url}">
    <!-- 滑块-->  
    <div class="magnifyingBegin"></div>
    <!-- 放大镜显示的图片 -->
    <div class="magnifyingShow" style="border:1px solid #CCC;"><img src="__PUBLIC__/Uploads/goods/{$result.pic_url}"></div>
  </div>
  
  <ul class="con-FangDa-ImgList">
    <!-- 图片显示列表 -->
      <foreach name="pic_tuji" item="vo_tuji">
    <li><img src="__PUBLIC__/Uploads/goods/{$vo_tuji}" data-bigimg="__PUBLIC__/Uploads/goods/{$vo_tuji}"></li>
      </foreach>
  </ul>
</div>


</div>




<input type="hidden" value="{$result.id}" class="id">
 <input type="hidden" value="{$result.price_new}" class="price">
  <div class="Original">
  	<img src="__PUBLIC__/Home/img/7.jpg" width="16" height="16">
    <img src="__PUBLIC__/Home/img/new.jpg" width="16" height="16">
    <img src="__PUBLIC__/Home/img/card.jpg" width="16" height="16">
    <img src="__PUBLIC__/Home/img/11111.jpg" width="16" height="16">
    <span>我们的服务</span>

    </div>
</div>
<div class="Detail-title" style="width:600px;">
	<h3 class="black size21" style=" font-size:20px; font-weight:600;">{$result.title}</h3>
	<input type="hidden" name="detail_title" id="detail_title" value="{$result.title}">
	 <input type="hidden" name="type" id="type" value="0">
    <ul>
	<li class="title-title" style="line-height:30px; padding-top:5px; padding-bottom:5px;">
        	<div><span class="left gray1" style="font-size:16px; ">市场价：</span><del class="left gray1" style="margin-right:15px; font-size:16px;">¥{$result.price_old}</del></div>
            <div style="clear:both;"></div>
			<div><span class="left" style="font-size:16px;">会员价：</span><span class="red size20 left" id="price_new_html" style=" font-weight:600; font-size:16px;">¥{$result.price_new}</span></div>
			<input type="hidden" name="price_old" id="price_old" value="{$result.price_old}">
      <input type="hidden" name="price_new" id="price_new" value="{$result.price_new}">
        </li>
        <li class="size12" style="overflow:hidden; margin:20px 0; font-size:16px; font-weight:500;">
        <span class="left">购买数量：</span>
          <div class="Quantity left" style="margin:0 8px;">



          	<!--判断是否为限购-->
              <if condition="$result.xiangou == 1">
              <span style="padding:5px 10px; background:#555; width: 300px; height:30px; color:#FFF; font-size:14px;">限购商品 , 每人限购 1 件</span>
                <input name="buy_nub" type="hidden" id="buy_nub" value="1" style="border:1px solid #CCC; width:30px; font-weight:600; height:26px; z-index:-100;">                 
              <else/>
                  <a href="javascript:;" onclick="jian_nub()" style="border:1px solid #ccc;padding:2px 10px;">-</a>
                  <input name="buy_nub" type="text" id="buy_nub" value="1" style=" border:1px solid #CCC; width:30px; font-weight:600; height:27px; position:relative; top:-2px;  z-index:-100;">
                  <a href="javascript:;" onclick="jia_nub()" style="border:1px solid #CCC;padding:2px 10px;">+</a>
              </if>
          </div>
        <span class="right" style="font-size:16px; font-weight:500;"><b style="font-weight:normal; margin-right:40px;">送积分:( <span style="color:#E32B36; font-weight:600;">{$result.fanli_jifen} 积分</span> )
        <input type="hidden" name="fanli_jifen" value="{$result.fanli_jifen}">
        </b>库存：1000 件</span>
        </li>  
        <li>




<style>
.guige{padding:5px 10px; border:2px solid #CCC; font-weight:500;}
.guige:hover{ border:2px solid #BE0106; cursor:pointer;}
</style>
<if condition="!empty($taocan)">
		<div style="font-size:16px; color:#666;">
		套餐选择：<br/>

		<foreach name="taocan" item="vo">

			<span class="guige" id="{$vo.guige_price_new}" style="margin-right:10px; display:block; float:left; margin-bottom:5px; padding:0 5px;" onclick="select_taocan(this);">{$vo.guige_title}</span>
    </foreach>

    <div style="clear:both;"></div>
		</div>
</if>
<script>
function select_taocan(_t){
  var taocan_price = $(_t).attr('id');
	$('.guige').attr("style","margin-right:10px; display:block; float:left; margin-bottom:5px; padding:0 5px;");
	$(_t).attr("style","border:2px solid #BE0106;margin-right:10px; display:block; float:left; margin-bottom:5px; padding:0 5px;"); 
  $('#price_new_html').html("￥"+taocan_price);
  $('#price_new').val(taocan_price);
  $('#price_new').val(taocan_price);
  $('#price_sum1').val(taocan_price);
  var taocan_name =  $(_t).html();
  $('#taocan_name').val(taocan_name);
  
  //alert(price);
}
</script>
        <div style=" margin-top:25px; ">
  
            <input type="hidden" name="id[]" value="{$result.id}">
            <input type="hidden" name="taocan_name[]" id="taocan_name" value="无">
            <input type="hidden" name="goods_title[]" id="goods_title"  value="{$result.title}">
            <input type="hidden" name="price_new[]" id="price_new" value="{$result.price_new}">
            <input type="hidden" name="goods_num[]" id="buy_nub1" value="1" />
            <input type="hidden" name="pic_url[]" id="pic_url" value="{$result.pic_url}" >
            <input type="hidden" name="price_sum" id="price_sum1" value="{$result.price_new}" >
            <input type="hidden" name="fanli_jifen[]" id="fanli_jifen" value="{$result.fanli_jifen}" >
            <input type="hidden" name="xiangou" id="xiangou" value="{$result.xiangou}" >
            <input type="hidden" name="now_buy" id="now_buy" value="1" >
            <input type="hidden" name="shoper_id" id="shoper_id" value="{$result.shoper_id}">

			  <input type="button"  id="button" value="收藏" class="buy"  onclick="join_collection({$result.id})" style=" width:80px; color:#ff7519; border:2px solid #ff7519; float:left; font-weight:normal;">





<if condition="$res_member['grade_name'] == '合伙人' || $res_member['grade_name']=='会员'">			  

 
    <if condition="$xiangou_yigoumai == 1 && $result.xiangou == 1">
      <span style="padding:5px 10px; background:#555; margin-left:20px; position: relative; top:5px; color:#FFF; font-size:14px; z-index:-22;">已选购 , 不可重复购买</span>
    <else/>
      <switch name="result['shangjia']" >
        <case value="1">
          <input type="submit" id="buy" value="立即购买" class="buy" style="color:#ff7519; border:2px solid #ff7519; float:left; font-weight:normal; margin-left:10px;">
        </case>
        <default />
        <span style="padding:10px 30px; background:#555; margin-left:20px; position: relative; top:5px; color:#FFF; font-size:16px; z-index:-22;">抱歉 , 此商品已下架</span>
      </switch>
    </if>

    <if condition="$result.xiangou != 1">
      <switch name="result['shangjia']" >
        <case value="1">
          <input type="button" name="button" id="button" value="加入购物车" onClick="add_cart({$result.id})" class="Join" style="background:url(__PUBLIC__/Home/img/shopping-cart.jpg) 5px no-repeat #ff7519; border:0">
        </case>
      </switch>
    </if>            

           

<else/>

<a href="{:U('User/huiyuan_zige')}"><span style="padding:10px 20px; background:#666;color:#FFF; margin-left:20px; z-index: -100; position:relative; top:5px; font-size:16px;">请晋升为会员，继续购物</span></a>
</if>




 
		  </div>

      
		</li>
    </ul>
</div>

<div style=" float:right;border:1px solid #CCC; padding:10px;">
<foreach name="list_rexiao" item="vo">
<div><a href="{:U('Index/goods_details')}?id={$vo.id}">
<img src="__PUBLIC__/Uploads/goods/{$vo.pic_url}" style=" width:177px;"/></a><br/>
<span style="color:red;font-weight:bold;">本站优惠价:¥{$vo.price_new}</span>
</div>
</foreach>
</div>

<!--缩图结束-->
</div>

<div class="left Simultaneously" id="left_tuijian">
  <h3>同时购买推荐</h3>
  <foreach name="list_tuijian" item="vo">
    <a href="{:U('Index/goods_details')}?id={$vo.id}">
    <img src="__PUBLIC__/Uploads/goods/{$vo.pic_url}" style="margin-right:5px; width:160px; height:120px;"><br/>
  </a>
  </foreach>
</div>

<div class="Detail-Content" style="float:left; width:970px !important;">
<ul id="tabs" style=" width:970px !important;">
    <li id="current"><a href="javascript:;" title="tab1">产品详情 </a></li>
    <li id=""><a href="javascript:;" title="tab2">商品参数</a></li>
    <li id=""><a href="javascript:;" title="tab3">用户评论</a></li>
</ul>

<div id="content">
    <div id="tab1" style="display: block;">
      	{$result.shuoming}
      </div>
    <div id="tab2" style="display: none;">
    	{$result.guige}
	</div>
    <div id="tab3" style="display: none;">
    <ul class="score2">
    	<h3>商品综合满意度</h3>
    </ul>    
             <p class="ccontent"><b class="bold Orange1">评价内容</b><b>共有{$count}个评价信息</b></p>
<ul class="commenttitle">

	  <foreach name="result_pingjia" item="vo_pingjia" >
        <li style="overflow: hidden; zoom: 1; margin-bottom: 10px; border-bottom: 1px solid #CCCCCC ">
            <p style=" text-align: center; float:left; width: 200px;  height: 100px; line-height: 100px">
<span>

  用户ID: {$vo_pingjia.user_id}
  
  <if condition="$vo_pingjia['pingjia_status'] == 1"><span style="padding:3px 10px; background:#F00; color:#FFF;">好评</span></if>
  <if condition="$vo_pingjia['pingjia_status'] == 2"><span style="padding:3px 10px; background:#367B41; color:#FFF;">中评</span></if>
  <if condition="$vo_pingjia['pingjia_status'] == 3"><span style="padding:3px 10px; background:#555; color:#FFF;">差评</span></if>
</span>

            </p>
            <p style="float:left; width: 500px; padding-left: 20px ">               
                <p>评价时间: {$vo_pingjia.pingjia_time|date="Y-m-d H:i:s",###}</p>
                <p>评价内容: {$vo_pingjia.pingjia_content}</p>
            </p>
        </li>
        <div style="clear: both;"></div>
   </foreach>
	
    </ul>   
</div>

</div>
</div>

</div>
</form>

<script>
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML=document.getElementById("demo1").innerHTML;
function Marquee(){
if(demo.scrollLeft-demo2.offsetWidth>=0){
 demo.scrollLeft-=demo1.offsetWidth;
}
else{
 demo.scrollLeft++;
}
}
var myvar=setInterval(Marquee,30);
demo.onmouseout=function (){myvar=setInterval(Marquee,30);}
demo.onmouseover=function(){clearInterval(myvar);}
</script>
<script>
$(document).ready(function() {
	$("#content div").hide(); // Initially hide all content
	$("#tabs li:first").attr("id","current"); // Activate first tab
	$("#content div:first").fadeIn(); // Show first tab content
    
    $('#tabs a').click(function(e) {
        e.preventDefault();        
        $("#content div").hide(); //Hide all content
        $("#tabs li").attr("id",""); //Reset id's
        $(this).parent().attr("id","current"); // Activate this
        $('#' + $(this).attr('title')).fadeIn(); // Show content for current tab
    });
})();
</script>


<script>
    //点击添加或者减少
   function jian_nub(){
        var buy_nub =  $('#buy_nub').val();
        var dif_nub = parseInt(buy_nub)-1;
        $('#buy_nub').val(dif_nub);
        $('#buy_nub1').val(dif_nub);
        if(dif_nub<1){
            alert('商品数量不能低于1');
            $('#buy_nub').val(1);
            $('#buy_nub1').val(dif_nub);
        }
        var b =  $('#buy_nub').val();
        price_sum(b)

    }
	
    function jia_nub(){
        var buy_nub =  $('#buy_nub').val();
        var dif_nub = parseInt(buy_nub)+1;
        $('#buy_nub').val(dif_nub);
        $('#buy_nub1').val(dif_nub);
        if(dif_nub>99){
            alert('商品数量不能超过99');
            $('#buy_nub').val(99);
            $('#buy_nub1').val(dif_nub);
        }
        var b =  $('#buy_nub').val();
        price_sum(b)
    }
	
	 /**
     *计算出商品的总价格
     *
     */
    function price_sum(b){
        var price_new = $('#price_new').val();
        var sum = parseFloat(price_new)*parseInt(b);
        $('#price_sum1').val(sum);
    }

    //添加到购物车
    function add_cart(goods_id){
      //alert(goods_id);
      var goods_num = $('#buy_nub').val();    //添加到购物车的数量
      var goods_title = $('#detail_title').val();
      var pic_url = $('#pic_url').val();
      var price_new = $('#price_new').val();
      var taocan_name = $('#taocan_name').val();
      var fanli_jifen = $('#fanli_jifen').val();
      var shoper_id = $('#shoper_id').val();
      var pic_url = $('#pic_url').val();
      var goods_title = $('#goods_title').val();
        $.post("{:U('Cart/add_cart')}", { goods_id:goods_id,goods_title:goods_title,pic_url:pic_url,goods_num:goods_num,taocan_name:taocan_name,price_new:price_new,fanli_jifen:fanli_jifen,shoper_id:shoper_id },function(data){
            if(data == 1){
                alert('成功加入购物车');
            }else if(data == 2){
                alert('请先登录');
                window.location.href="{:U('Public/login')}";
            }else{
                alert('加入失败');
            }
        },"json");
    }
	
	//加入收藏
    function join_collection(id){
		var is_type=$('#type').val();
        var pic_url = $('#pic_url').val();
        var price_old = $('#price_old').val();
        var price_new = $('#price_new').val();
        var detail_title = $('#detail_title').val();
        $.post("{:U('Cart/join_coll')}", { "goods_id":id,"pic_url":pic_url,"price_old":price_old,"price_new":price_new,"detail_title":detail_title,"is_type":is_type},
                function(data){
                  if(data==1){
                        alert('该商品已经被收藏');
                    }else if(data==2){
                        alert('收藏成功');
                    }else if(data==4){
                        window.location.href="{:U('Public/login')}"
                    }else{
                        alert('收藏失败');
                    }
         }, "json");

    }
	
	  function big_img(i){
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
          /*  area: ['500px', '500px'],*/
            skin: 'layui-layer-nobg', //没有背景色
            shadeClose: true,
            content: '<img src="__PUBLIC__/Uploads/comment/'+i+'"/>'
        });
    }
	
	
</script>
	

		
		<include file="Public:footer" />
		
	</body>

</html>